package com.gin.kotlin.no_gay_alliance.fragment.topiclist

import android.content.Context
import android.os.Bundle
import com.gin.kotlin.no_gay_alliance.activity.TopicListActivity
import com.gin.kotlin.no_gay_alliance.activity.TopicListActivity.Companion.KEY_ARGUMENT
import com.gin.kotlin.no_gay_alliance.argument.TopicListArgument
import com.gin.kotlin.no_gay_alliance.databinding.FragmentTopicListForumRecommendBinding

/**
 * 版面精华区
 */
class ForumRecommendFragment :AbstractTopicListFragment<FragmentTopicListForumRecommendBinding>(){

    companion object {
        fun newInstance(argument: TopicListArgument)
        = ForumRecommendFragment().also { it.arguments = Bundle().also { b -> b.putParcelable(KEY_ARGUMENT, argument) } }

        /**
         * 启动活动
         */
        fun startActivity(
            context: Context,
            forumId: Long,
            page: Int? = null,
            title: String? = null
        ) = TopicListActivity.startActivity(
            context, TopicListArgument(
                TopicListArgument.Type.FORUM_RECOMMEND,
                forumId = forumId,
                page = page,
                title = "[精]$title"
            )
        )
    }
}